﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MediatorPattern.DemoOne
{
    /// <summary>
    /// 採購管理
    /// </summary>
    public class Purchase
    {
        /// <summary>
        /// 採購IBM電腦
        /// </summary>
        /// <param name="number"></param>
        public void buyIBMComputer(int number) {

            Stock stock = new Stock();

            Sale sale = new Sale();

            int saleStatus = sale.getSaleStatus();

            if (saleStatus > 80)
            {
                stock.increase(number);
            }
            else
            {
                int buyNumber = number / 2;
            }
            
        }

        /// <summary>
        /// 不再採購IBM電腦
        /// </summary>
        /// <returns></returns>
        public bool refuseBuyIBM() {
            return false;
        }
    }
}
